﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TTEngine
{
    public class SpiderWeb : MapObject
    {
        //constructor
        public SpiderWeb()
            : base()
        {
            Flamability = 100;
            CanTake = true;
        }

        //object name
        public override string ObjectName
        {
            get
            {
                return "Spider Web";
            }
        }

        //clone
        public override MapObject Clone()
        {
            return new SpiderWeb();
        }

        //image
        public override Bitmap Image
        {
            get
            {
                return Properties.Resources.SpiderWeb;
            }
        }

        //prohibits movement?
        public override bool ProhibitsMovement(Actor actor)
        {
            if (actor.HasTag("Arachnid"))
                return false;
            if (actor.HasTag("Flyer"))
                return false;
            if (actor.PerformTest(Abilities.Strength, 3, 20) && Globals.Random.NextDouble() > 0.5)
               return false;
            Level.Host.ShuffleSprite(actor);
            return true;
        }
    }
}
